import request from "@/utils/request";

//更新个人信息
export function updateUserInfoAPI(user) {
    return request({
        url:'/User/update',
        method:'put',
        data:user
    })
}

//添加用户
export function addUserAPI(user) {
    return request({
        url:'/User/add',
        method:'post',
        data:user
    })
}

//删除用户
export function deleteUserByUidAPI(uid) {
    return request({
        url:`/User/delete/${uid}`,
        method:'delete',
    })
}

//修改密码
export function updatePasswordAPI(user) {
    return request({
        url:'/updatePassword',
        method:'put',
        data:user
    })
}

//分页查询用户列表
export function getUserListByPageAPI(pageSize,pageNum) {
    return request({
        url:'User/selectPage',
        method:'get',
        params:{
            pageSize:pageSize,
            pageNum:pageNum
        }
    })
}

//更新头像

export function updateAvatarAPI(formData) {
    return request({
        url:'/User/UserAvatar/update',
        method:'post',
        data:formData
    })
}